extends Node2D

onready var MAIN = find_parent("MAIN")
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
var pulsating = true
var phase = 0
var hertz = 1

# Called when the node enters the scene tree for the first time.

func _process(delta: float) -> void:
	if MAIN.started:
		var separation = get_global_mouse_position().y - position.y
		position.y += separation*0.2
		if pulsating:
			phase += delta*hertz*2*PI
			scale.x = 1 + pow(sin(phase),2)*0.25
			scale.y = 1 - pow(sin(phase+0.1),2)*0.15
		var frame = int (phase*2) % 3
		for c in $scaler.get_children():
			c.visible =  c.name == String(frame)
		
		

func _ready() -> void:
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta: float) -> void:
#	pass
